//
//  MySelfTableViewCell.m
//  DaiShengInvest
//
//  Created by 张睿 on 2017/6/28.
//  Copyright © 2017年 davinci. All rights reserved.
//

#import "MySelfTableViewCell.h"

@interface MySelfTableViewCell ()

@property (nonatomic, weak)UIImageView * backImage;



@property (nonatomic, weak)UIImageView * rightView;

@end

@implementation MySelfTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    
    return self;
}


- (void)setupUI{
    
    self.backgroundColor = [UIColor clearColor];
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    UIImageView * iconImage = [[UIImageView alloc] init];
    
    self.iconImage = iconImage;
    
    [self addSubview:self.iconImage];
    
    [self.iconImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self).offset(22 * SCREENH6);
        make.centerY.mas_equalTo(self);
        make.width.height.mas_equalTo(20 * SCREENH6);
    }];
    
    UILabel * explationLabel = [UILabel new];
    
    explationLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15 * SCREENH6];
    explationLabel.textColor = ColorWithRGB(0xe7e7e7);
    
    self.explationLabel = explationLabel;
    
    [self addSubview:self.explationLabel];
    
    [self.explationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.iconImage.mas_trailing).offset(5 * SCREENH6);
        make.centerY.mas_equalTo(self);
    }];
    
    
    UIImageView * rightView = [[UIImageView alloc] init];
    
    rightView.image = [UIImage imageNamed:@"修改头像"];
    
    self.rightView = rightView;
    
    [self addSubview:self.rightView];
    
    [self.rightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.mas_equalTo(self).offset(-15 * SCREENH6);
        make.centerY.mas_equalTo(self);
        make.width.mas_equalTo(10 * SCREENH6);
        make.height.mas_equalTo(18 * SCREENH6);
    }];
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
